<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组concat</title>
</head>

<body>
    <script>
        /**
         *  数组concat返回新数组，不会影响原数组（浅拷贝）
         

         
         */

        // 数组拼接
        const array1 = ['a', 'b', 'c'];
        const array2 = ['d', 'e', 'f'];
        const array3 = array1.concat(array2);
        console.log(array3); // ["a", "b", "c", "d", "e", "f"]

        // 连接多个数组
        const num1 = [1, 2, 3];
        const num2 = [4, 5, 6];
        const num3 = [7, 8, 9];
        const numbers = num1.concat(num2, num3);
        console.log(numbers); // [1, 2, 3, 4, 5, 6, 7, 8, 9]

        // 将值连接到数组
        const letters = ["a", "b", "c"];
        const alphaNumeric = letters.concat(1, [2, 3]);
        console.log(alphaNumeric); // ['a', 'b', 'c', 1, 2, 3]

        // 
    </script>
</body>

</html>